package com.clusterswisdom.horn.api.tmall.action.item;

import com.alibaba.fastjson.JSONObject;
import com.clusterswisdom.horn.api.ioc.HornAction;
import com.clusterswisdom.horn.api.ioc.HornResponse;
import com.clusterswisdom.horn.api.ioc.api.ApiConfig;
import com.clusterswisdom.horn.api.tmall.TmallInstance;
import com.clusterswisdom.horn.api.tmall.action.AbstractTmallAction;
import com.taobao.api.response.ItemSkuGetResponse;

public class GetSkuAction extends AbstractTmallAction implements HornAction{
	@Override
	public HornResponse execute(ApiConfig config, JSONObject param)
			throws Exception {
		ItemSkuGetResponse response=(ItemSkuGetResponse)TmallInstance.getInstance().executeRequest(param, "item", "skuGet");
		if(response.isSuccess()){
			return new HornResponse(true, response.getSku());
			
		}else{
			return getUnsuccessResponse(response);
			
		}
	}
}
